
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>smp.correct_temperature &#8212; Texas A&amp;M Oil spill / Outfall Calculator 2.1.0 documentation</title>
    <link rel="stylesheet" href="../../_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="smp.cp_model" href="smp.cp_model.html" />
    <link rel="prev" title="smp.calculate" href="smp.calculate.html" />
   
  <link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="smp-correct-temperature">
<h1>smp.correct_temperature<a class="headerlink" href="#smp-correct-temperature" title="Permalink to this headline">¶</a></h1>
<dl class="function">
<dt id="smp.correct_temperature">
<code class="sig-prename descclassname">smp.</code><code class="sig-name descname">correct_temperature</code><span class="sig-paren">(</span><em class="sig-param">r</em>, <em class="sig-param">yi</em>, <em class="sig-param">particles</em>, <em class="sig-param">profile</em>, <em class="sig-param">p</em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/smp.html#correct_temperature"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smp.correct_temperature" title="Permalink to this definition">¶</a></dt>
<dd><p>Make sure the correct temperature is stored in the state space solution</p>
<p>When the dispersed phase particles equilibrate to their surrounding 
temperature, heat transfer is turned off by the methods in 
<cite>dispersed_phases.Particle</cite>.  This is needed to prevent numerical
oscillations as the particles become small.  Unfortunately, it is not as
easy to make the numerical solution output the correct result once 
particle temperature effectively stops being a state space variable.</p>
<p>Once heat transfer is turned off, all of the model methods use the 
correct temperature (e.g., the ambient temperature) in all of the 
equations coupled to the heat transfer equation and in all equations 
involving particle temperature.</p>
<p>In order to prevent the state space variable for particle temperature 
from blowing up as the mass goes to zero, we also continue to adjust the
particle heat in the ODE solution to maintain a constant temperature. 
This is done by setting <cite>beta_T = 0</cite>.  This is merely a numerical trick, 
as all equations using the particle temperature know to use the ambient
temperature when this is the case.</p>
<p>Hence, the purpose of this function is to simply overwrite the state 
space solution containing the particle heat (returned by the ODE solver
to maintain a constant particle temperature) with the correct particle
heat yielding the ambient temperature for the particle temperature.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>r</strong><span class="classifier"><cite>scipy.integrate.ode</cite> object</span></dt><dd><p>ODE solution containing the currect values of the state space (e.g., 
<cite>r.y</cite>).</p>
</dd>
<dt><strong>yi</strong><span class="classifier"><cite>InnerPlume</cite></span></dt><dd><p>Object for manipulating the inner plume state space</p>
</dd>
<dt><strong>particles</strong><span class="classifier">list of <cite>Particle</cite> objects</span></dt><dd><p>List of <cite>Particle</cite> objects containing the dispersed phase local
conditions and behavior.</p>
</dd>
<dt><strong>profile</strong><span class="classifier"><cite>ambient.Profile</cite> object</span></dt><dd><p>The ambient CTD object used by the simulation.</p>
</dd>
<dt><strong>p</strong><span class="classifier"><cite>ModelParams</cite> object</span></dt><dd><p>Object containing the fixed model parameters for the stratified 
plume model.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl>
<dt><strong>r</strong><span class="classifier"><cite>scipy.integrate.ode</cite> object</span></dt><dd><p>Returns the original ODE object with the corrected solution stored
in the public x and y.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>

</div>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="../../index.html">Texas A&M Oil spill / Outfall Calculator</a></h1>








<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../../user_manual.html">TAMOC User Manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../unit_tests.html">Unit Tests</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary.html">Glossary</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../bugs.html">Reporting Bugs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../readme.html">Read Me File</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../release.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../license.html">License</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="../../index.html">Documentation overview</a><ul>
  <li><a href="../../user_manual.html">TAMOC User Manual</a><ul>
  <li><a href="../../modules/spm.html">Overview of Stratified Plume Model Module</a><ul>
      <li>Previous: <a href="smp.calculate.html" title="previous chapter">smp.calculate</a></li>
      <li>Next: <a href="smp.cp_model.html" title="next chapter">smp.cp_model</a></li>
  </ul></li>
  </ul></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2020, Scott A. Socolofsky.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 2.4.4</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
      
      |
      <a href="../../_sources/autodoc/spm/smp.correct_temperature.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>